/*
 * @Author: didididijiajiajia 11643763+didididijiajiajia@user.noreply.gitee.com
 * @Date: 2023-08-21 22:29:20
 * @LastEditors: didididijiajiajia 11643763+didididijiajiajia@user.noreply.gitee.com
 * @LastEditTime: 2023-08-28 10:55:02
 * @FilePath: \vue低代码101-111\低代码平台\src\utils\editor-config.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
//列表区域显示所有的物料
//key对应组件的映射关系
import {ElButton,ElInput,ElAutocomplete,ElCheckbox } from 'element-plus'

function createEditorConfig(){
    const componentList=[]
    const componentMap={}
    return {
        componentList,
        componentMap,
        register:(component)=>{
            componentList.push(component)
            componentMap[component.key] = component
        }
    }
}
export let registerConfig=createEditorConfig();
registerConfig.register({
    label:"文本",
    preview:()=>'预览文本',
    render:()=>'渲染文本',
    key:'text'
})
registerConfig.register({
    label:"输入框",
    preview:()=><ElInput placeholder='预览输入框'></ElInput>,
    render:()=><ElInput placeholder='渲染输入框'></ElInput>,
    key:'input'
})
registerConfig.register({
    label:"按钮",
    preview:()=><ElButton>预览按钮</ElButton>,
    render:()=><ElButton>渲染按钮</ElButton>,
    key:'button'
})
registerConfig.register({
    label:"自动补全输入框",
    preview:()=><ElAutocomplete>预览自动补全输入框</ElAutocomplete>,
    render:()=><ElAutocomplete>渲染自动补全输入框</ElAutocomplete>,
    key:'autocomplete'
})
registerConfig.register({
    label:"选择框",
    preview:()=><ElCheckbox></ElCheckbox>,
    render:()=><ElCheckbox></ElCheckbox>,
    key:'checkbox'
})